package com.qidian.mes.pro.controller;

import com.qidian.mes.pojo.pro.ProProcessContent;
import com.qidian.mes.pro.service.ProProcessContentService;
import com.qidian.mes.util.pojo.MESResult;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.sound.sampled.Port;

/**
 * @Author 郭靖旖
 * @Company
 * @Time 2023/10/31 17:42
 * @Description
 **/
@RestController
@RequestMapping("/processContent")
@CrossOrigin
public class ProProcessContentController {
    @Autowired
    ProProcessContentService proProcessContentService;
    @GetMapping("/get")
    public MESResult get(int page,int limit,String processCode){
        return proProcessContentService.selectByProcessId(page,limit,processCode);
    }
    @PostMapping("/save")
    public MESResult save(@RequestBody ProProcessContent proProcessContent){
        return proProcessContentService.save(proProcessContent);
    }
    @GetMapping("/selectByprocessCode")
    public MESResult selectByprocessCode(String processCode){
        return proProcessContentService.selectByprocessCode(processCode);
    }
    @PostMapping("/update")
    public MESResult update(@RequestBody ProProcessContent proProcessContent){
        System.err.println(proProcessContent.getContentId());
        return proProcessContentService.updateProProcessContent(proProcessContent);
    }
    @DeleteMapping("/deleteProcessContent")
    public MESResult deleteProcessContent(Long contentId){
        return proProcessContentService.deleteProProcessContent(contentId);
    }
}
